// components/border-image.js
Component({
  lifetimes: {
    created() {
      console.log('组件创建');
    },
    attached() {
      console.log('组件挂载');
    },
    detached() {
      console.log('组件移除');
    }
  },
  /**
   * 组件的属性列表
   */
  properties: {
    // 父传子2, 接收
    imgurl: {
      type: String,
      // 默认值
      value: 'https://ts1.cn.mm.bing.net/th/id/R-C.de1c36605156dbc6778fa272d9bd642c?rik=YXDWxYeV%2bQeDiw&riu=http%3a%2f%2fpic.bizhi360.com%2fbbpic%2f68%2f9468.jpg&ehk=4EtegoGe5VIOg5MAJjoMo044FvKcsr8w8kddsuEEepY%3d&risl=&pid=ImgRaw&r=0'
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleTap() {
      console.log('子组件被点击');
      // 子传父1, 主动通知父组件
      this.triggerEvent('clickUrl', this.properties.imgurl)
    }
  }
})
